package py.filter;

import java.util.ArrayList;
import java.util.HashMap;


import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.xssf.usermodel.XSSFCell;

import py.ColumnStrategy;
import py.SwitchConfig;
import py.filter.impl.DelFilterHandle;

public class FilterManager {

	public static HashMap<Integer,ColumnStrategy> delConMap=new HashMap<Integer,ColumnStrategy>();
	public static DelFilterHandle delFilter=new DelFilterHandle();   //删除逻辑过滤器
	static
	{
		//遍历过滤器
		ArrayList<ColumnStrategy> list=SwitchConfig.getDesCols();
		for (int i =0 ;i<list.size();i++) {
			ColumnStrategy columnStrategy = list.get(i);
			if(columnStrategy.getFc()!=null)
			{
				FilterCond fc=columnStrategy.getFc();
				if(fc.getFilerType().equals("del"))
					delConMap.put(i, columnStrategy);      //i为目标文件中的第几列
			}
		}
		
	}
	
	public static XSSFCell[] handleFilter(XSSFCell[] cs)
	{
		XSSFCell[] result=delFilter.handle(cs);
		 return result;
	}
	
}
